<template>
  <div class="company">
    <section class="widget">
      <router-link to="/job" tag="div" class="page-header" style="position:relative;cursor:pointer">
        <h3>公司</h3>
        <h4 style="position: absolute;right: 100px;top: 4px;">更多></h4>
      </router-link>
      <ul id="recentcomments">
        <li class="recentcomments" v-for="(company,id) in company " :key="id">
          <router-link :to="'/companycontent/'+company.company_id">{{company.company_name}}</router-link>
        </li>
      </ul>
      <!--<el-pagination
        style="position: absolute;right: 100px;top: 4px;"
        @current-change="handleCurrentChange"
        layout="prev, next"
        :total="pagelistquery.total"
      ></el-pagination>-->
    </section>
  </div>
</template>

<script>
export default {
  name: 'company',
  data () {
    return {
      pagelistquery: {
        lable: '',
        tag: '',
        total: 0,
        pagesize: 5,
        page: 1
      },
      company: []
    }
  },
  methods: {
    async getCompanyList () {
      const result = await this.$axios.post('/web/getcompanylist', this.qs.stringify(this.pagelistquery))
      if (result.data.state.type === 'SUCCESS') {
        this.company = result.data.data
      }
    },
    handleCurrentChange (val) {
      this.pagelistquery.page = val
      this.getCompanyList()
    }
  },
  created () {
    this.getCompanyList()
  }
}
</script>

<style scoped>

</style>
